package com.woniu.command.handle;

import com.woniu.adapter.ProPlanAdapter;
import com.woniu.client.OrderClient;
import com.woniu.outlet.po.OrderPo;
import com.woniu.outlet.po.ProPlanPo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class ProPlanCommandHandle {

    @Autowired
    private ProPlanAdapter proPlanAdapter;
    //添加生产计划
    public String addProPlan(ProPlanPo po){
        try {
            proPlanAdapter.addProPlan(po);
            return "添加成功";
        } catch (Exception e) {
            e.printStackTrace();
            return "添加失败"+e.getMessage();
        }
    }

    //修改生产计划
    public String updateProPlan(ProPlanPo po){
        try {
            proPlanAdapter.updateProPlan(po);
            return "修改成功";
        } catch (Exception e) {
            e.printStackTrace();
            return "修改失败"+e.getMessage();
        }
    }

    //删除生产计划单
    public String deleteProPlanById(Long id){
        try {
            proPlanAdapter.deleteProPlanById(id);
            return "删除成功";
        } catch (Exception e) {
            e.printStackTrace();
            return "删除失败"+e.getMessage();
        }
    }
}
